package com.ck.dao;

import com.ck.model.common.ModuleButton;
import org.apache.ibatis.annotations.*;

public interface ModuleButtonMapper {
    @Delete({
        "delete from ck_module_button",
        "where role_module_id = #{roleModuleId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long roleModuleId);

    @Insert({
        "insert into ck_module_button (role_module_id, module_id, ",
        "button_id)",
        "values (#{roleModuleId,jdbcType=BIGINT}, #{moduleId,jdbcType=BIGINT}, ",
        "#{buttonId,jdbcType=BIGINT})"
    })
    int insert(ModuleButton record);

    int insertSelective(ModuleButton record);

    @Select({
        "select",
        "role_module_id, module_id, button_id",
        "from ck_module_button",
        "where role_module_id = #{roleModuleId,jdbcType=BIGINT}"
    })
    ModuleButton selectByPrimaryKey(Long roleModuleId);

    int updateByPrimaryKeySelective(ModuleButton record);

    @Update({
        "update ck_module_button",
        "set module_id = #{moduleId,jdbcType=BIGINT},",
          "button_id = #{buttonId,jdbcType=BIGINT}",
        "where role_module_id = #{roleModuleId,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(ModuleButton record);
}